package top.drinyeit.nongmao.adapter;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by bigHead on 2017/11/13.
 */

public class MyOrderAdapter extends FragmentPagerAdapter{

    private List<Fragment> list;
    private List<String> mNameList;

    public MyOrderAdapter(FragmentManager fm) {
        super(fm);
    }
    public MyOrderAdapter(FragmentManager fm, List<Fragment> list, List<String> mNameList){
        super(fm);
        this.list=list;
        this.mNameList = mNameList;
    }

    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return mNameList.get(position);
    }
}
